import React from 'react';

import { type SkeletonProps, Skeleton } from '@mantine/core';
import classNames from 'classnames';
import styles from './Skeleton.module.less';
import { mergeClassNames } from '../tools';

interface ExtendedTextProps extends SkeletonProps {
  children: React.ReactNode;
}
export const NSkeleton = React.memo(({ className, children, ...restProps }: ExtendedTextProps) => {
  {
    return (
      <Skeleton
        className={classNames(className)}
        classNames={mergeClassNames(styles, restProps.classNames)}
        {...restProps}
      >
        {children}
      </Skeleton>
    );
  }
});
